
#ifndef _BALLGAME_H
#define _BALLGAME_H

#include <SDL\SDL.h>
#include <SDL\SDL_ttf.h>
#include <cstdlib>
#include <ctime>

#include "CEvent.h"
#include "CFPS.h"
#include "CSurface.h"
#include "defs.h"
#include "CAnimation.h"
#include "CEntity.h"
#include "CBarra.h"
#include "CBola.h"
#include "CItem.h"
#include "CBloco.h"
#include "CSound.h"
#include "Texto.h"
#include "ItemDesc.h"
#include "PontosText.h"
#include "BolasRestantes.h"
#include "Level.h"

class BallGame : public CEvent {

	private:
		bool			running;
		bool			paused;
		bool			gameOver;
		bool			won;
		SDL_Surface*	displaySurface;
		SDL_Surface*	testSurface;
		CBarra			barra;
		CBola			bola;
		CBola			bolaExtra;
		CItem			item;
		Texto			gameTitle;
		PontosText		pontosText;
		Texto			pauseText;
		Texto			gameOverText;
		Texto			levelText;
		Texto			wonText;
		BolasRestantes	bolasText;
		ItemDesc		itemDesc;
		Level			level;
		char			captionString[85];

	public:
		BallGame();
	   ~BallGame();
	    
	   int onExecute();
	   bool onInit();
	   void onLoop();
	   void onRender();
	   void onCleanup();

	   bool initSounds();
	   bool initTexts();
	   bool initImages();
	   bool toogleFullScreen();
	   void resetGame();

	   //Events
	   void OnExit();
	   void OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode);
	   void OnKeyUp(SDLKey sym, SDLMod mod, Uint16 unicode);
	   void OnMouseMove(int mX, int mY, int relX, int relY, bool Left,bool Right,bool Middle);
};

#endif